package com.example.service.impl;

import com.example.dao.BlogMapper;
import com.example.model.Blog;
import com.example.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class BlogServiceImpl implements BlogService {
    @Autowired
    private BlogMapper blogMapper;

    @Override
    public List<Blog> selectBlog() {
        return blogMapper.selectBlog();
    }

    @Override
    public List<Blog> selectBlogByID(Integer id) {
        return blogMapper.selectBlogById(id);
    }

    @Override
    public List<Blog> selectBlogByTitle(Map<String, Object> map) {
        return blogMapper.selectBlogByTitle(map);
    }

    @Override
    public int addBlog(Blog blog) {
        return blogMapper.addBlog(blog);
    }

    @Override
    public int updataBlog(Blog blog) {
        return blogMapper.updateBlog(blog);
    }

    @Override
    public int deleteBlog(Integer id) {
        return blogMapper.deleteBlog(id);
    }
}
